import 'package:simple_pwd_node/util/db_bean.dart';

class Record extends DbBaseBean {
  String id;

  String name;

  String account;

  String password;

  String remark;

  Record({this.id, this.name, this.account, this.password, this.remark});

  Record.fromJson(map){
    id = map['id'].toString();
    name = map['name'];
    account = map['account'];
    password = map['password'];
    remark = map['remark'];
  }

  @override
  DbBaseBean fromJson(Map<String, dynamic> map) {
    var id = map['id'].toString();
    var name = map['name'];
    var account = map['account'];
    var password = map['password'];
    var remark = map['remark'];
    return new Record(
      id: id,
      name:name,
      account: account,
      password: password,
      remark: remark
    );
  }

  @override
  String getTableName() {
    return 'record';
  }

  @override
  Map<String, dynamic> toJson() {
    Map<String, dynamic> map = new Map();
    map['id'] = id;
    map['name'] = name;
    map['account'] = account;
    map['password'] = password;
    map['remark'] = remark;
    return map;
   }

   @override
  String toString() {
    // TODO: implement toString
    return this.toJson().toString();
  }
}
